module.exports = {
  apps: [{
    name: 'wayback-archive',
    script: 'server.js',
    instances: 1,
    autorestart: true,
    watch: false,
    max_memory_restart: '1G',
    env: {
      NODE_ENV: 'development',
      PORT: 5001
    },
    env_production: {
      NODE_ENV: 'production',
      PORT: 5001,
      // 生产环境配置
      MAX_FILE_SIZE: '10MB',
      UPLOAD_DIR: '/var/www/wayback-archive/uploads'
    },
    // 日志配置
    log_file: '/var/log/wayback-archive/combined.log',
    out_file: '/var/log/wayback-archive/out.log',
    error_file: '/var/log/wayback-archive/error.log',
    time: true,
    // 进程管理
    min_uptime: '10s',
    max_restarts: 10,
    kill_timeout: 5000
  }]
};